package com.baseDemo.web.dao.authority.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.baseDemo.web.dao.authority.AuthorityEntityDao;
import com.baseDemo.web.entity.AuthorityEntity;
import com.share.hibernate.baseDaoSupport.impl.BaseDaoHibernateSupport;
@Repository
public class AuthorityEntityDaoHibernate extends BaseDaoHibernateSupport<AuthorityEntity> implements AuthorityEntityDao{
	private static Map<String, Object> paramMap = new HashMap<String, Object>();
	@Override
	public List<AuthorityEntity> getAuthorityByNavigation(String navigationid) {
		String HQL = "from AuthorityEntity ae where ae.navigationid = :navigationid ";
		paramMap.clear();
		paramMap.put("navigationid", navigationid);
		return super.find(HQL, paramMap);
	}
	@Override
	public String updateAuthority(AuthorityEntity authorityEntity) {
		String HQL = "update AuthorityEntity ae set ae.authorityDescription = :authorityDescription where ae.id = :id ";
		paramMap.clear();
		paramMap.put("id", authorityEntity.getId());
		paramMap.put("authorityDescription", authorityEntity.getAuthorityDescription());
		return super.execute(HQL, paramMap);
	}

}
